package com.mingqijia.gassafety.authority.api.req.manager;

import com.mingqijia.gassafety.shared.constant.Constants;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.io.Serializable;
import java.util.List;

/**
 * 创建管理员请求
 * @author Damon S.
 * @version v0.2
 * @date 2021-06-19
 */
@Data
@ApiModel(value = "创建管理员请求")
public class CreateManagerReqDTO implements Serializable {

    @NotNull(message = "请设置姓名")
    @ApiModelProperty(value = "姓名", required = true)
    @Pattern(regexp = Constants.REGEXP_NAME, message = "姓名应满足2-16位汉字、字母、数字")
    private String name;

    @NotNull(message = "请设置账号")
    @ApiModelProperty(value = "账号", required = true)
    @Pattern(regexp = Constants.REGEXP_USERNAME, message = "账号应满足2-16位字母/下划线开头，包含字母/数字/下划线")
    private String username;

    @NotNull(message = "请设置手机号码")
    @ApiModelProperty(value = "手机号码", required = true)
    @Pattern(regexp = Constants.REGEXP_PHONE, message = "手机号码不合法")
    private String phone;

    @ApiModelProperty(value = "所属组织，平台级/集团级账户必填")
    private List<String> hierarchy;

    @ApiModelProperty(value = "所属部门，企业级账户必填")
    private List<String> department;

    @ApiModelProperty(value = "所属角色列表")
    private List<String> roleId;

    @ApiModelProperty(value = "说明信息")
    @Pattern(regexp = "^.{0,200}$", message = "说明超过200字限制")
    private String description;
}
